#ifndef __PHONIC_CONFIG_API_H__
#define __PHONIC_CONFIG_API_H__

#ifdef	__cplusplus
extern "C"{
#endif

#define REG_NAME_DEBUG							  _T("debug")				//[...\phonic\] Debug = xxx
#define REG_ISDN_CARD_COUNT						  _T("isdn_card_count")				//[...\phonic\] Debug = xxx
#define REG_NAME_DTMF_TWIST		  				  _T("dtmf_twist")
#define REG_NAME_CHECK_HANGUP_TIMES               _T("check_hangup_times")
#define REG_NAME_CHECK_HELLO_ENERGY_VALUE         _T("check_hello_energy_value")	
#define REG_NAME_HOOK_SMOOTH       			      _T("hook_smooth")
#define REG_NAME_RING_SMOOTH       			      _T("ring_smooth")
#define REG_NAME_SLIC_FLASH_JUDGE_TIME			  _T("slic_flash_judge_time")
#define REG_NAME_SLIC_ELIMINATE_DITHER_TIME       _T("slic_eliminate_dither_time")
#define REG_NAME_SLIC_RING_TIME				      _T("slic_ring_time")
#define REG_NAME_SLIC_STOP_RING_TIME              _T("slic_stop_ring_time")
#define REG_NAME_MISS_CALL_TIME                   _T("miss_call_time")
#define REG_NAME_START_FSK_RECV_ON_RING			  _T("start_fsk_recv_on_ring")
#define REG_NAME_RECORD_CALLER_AUTOMATICALLY	  _T("record_caller_automatically")
#define REG_NAME_CALLER_TYPE					  _T("caller_type")
#define REG_NAME_RECORD_LENGTH_OF_CALLER		  _T("record_length_of_caller")
#define REG_NAME_ENABLE_DETECT_DIAL_TONE_BEFORE_DIAL  _T("enalbe_detect_dial_tone_before_dial")
#define REG_NAME_ENABLE_ECHO_CANCEL 			  _T("enable_echo_cancel")
#define REG_NAME_CHECK_HELLO_TIMES				  _T("check_hello_times")
#define REG_NAME_CHECK_HELLO_TONE_TIME_MIN		  _T("check_hello_tone_time_min")
#define REG_NAME_CHECK_HELLO_TONE_TIME_MAX        _T("Check_hello_tone_time_max")
#define REG_NAME_IGNORE_BUSY_SILENCE			  _T("ignore_busy_silence")
#define REG_NAME_DOUBLE_TONE_DEVIATION			  _T("double_tone_deviation")
#define REG_NAME_ANSWER_JUDGE_BY_PC_VOICE		  _T("answer_judge_by_pc_voice")
#define REG_NAME_BUSY_TONE_TIME                   _T("busy_tone_time")
#define REG_NAME_BUSY_SILENCE_TIME                _T("busy_silence_time")
#define REG_NAME_BUSY_VALID		                  _T("busy_valid")
#define REG_NAME_BUSYTONE_STRING    		 	  _T("busytone_string")
#define REG_NAME_BUSYTONE_SINGLE_FRE1		 	  _T("busytone_single_fre1")
#define REG_NAME_BUSYTONE_SINGLE_FRE2             _T("busytone_single_fre2")
#define REG_NAME_DTMF_DETECT_THR_STDTWI	 	 	  _T("dtmf_detect_thr_stdtwi")
#define REG_NAME_DTMF_DETECT_THR_REVTWI      	  _T("dtmf_detect_thr_revtwi")
#define REG_NAME_DTMF_DETECT_THR_ROWREL	 		  _T("dtmf_detect_thr_rowrel")
#define REG_NAME_DTMF_DETECT_THR_ROW2ND	 		  _T("dtmf_detect_thr_row2nd")
#define REG_NAME_DTMF_DETECT_THR_COLREL	 	      _T("dtmf_detect_thr_colrel")
#define REG_NAME_DTMF_DETECT_THR_COL2ND	 		  _T("dtmf_detect_thr_col2nd")
#define REG_NAME_DTMF_DETECT_THR_SIGNAL   	 	  _T("dtmf_detect_thr_signal")	
#define REG_NAME_DTMF_DETECT_WINDOW				  _T("dtmf_detect_window")
#define REG_NAME_DTMF_DETECT_WINDOW_HOOK_ON		  _T("dtmf_detect_window_hook_on")
#define REG_NAME_AC_FSK_CALLER_TYPE 	 	 	  _T("ac_fsk_caller_type")
#define REG_NAME_AC_PROGRAM_CODE      			  _T("ac_program_code")
#define REG_NAME_SLIC_RING_TIME      			  _T("slic_ring_time")
#define REG_NAME_SLIC_STOP_RING_TIME   			  _T("slic_stop_ring_time")
#define REG_NAME_DUAL_BUSY_TONE   			      _T("dual_busy_tone")
#define REG_NAME_BUSY_TONE_ENERGY   			  _T("busy_tone_energy")
#define REG_NAME_MAX_INTERVAL_BUSYTONE_TO_SUM     _T("max_inverval_busytone_to_sum")
#define REG_NAME_HOWLING_ENERGY   			      _T("howling_energy")
#define REG_NAME_HOWLING_LENGTH   			      _T("howling_length")

struct tagBusyTone
{
	ULONG _busy_tone_time;
	ULONG _busy_silence_time;
	ULONG _busy_valid;
};
const LONG NUM_BUSYTONE_ARRAY_SIZE =  5;




const LONG DEF_DTMF_DETECT_WINDOW = 20;
const LONG DEF_DTMF_DETECT_WINDOW_HOOK_ON = 0;
const LONG DEF_DTMF_DETECT_WINDOW_FOR_CONFERENCE = 20;
const LONG DEF_DTMF_DETECT_THR_STDTWI = 2000;
const LONG DEF_DTMF_DETECT_THR_REVTWI = 1259;
const LONG DEF_DTMF_DETECT_THR_ROWREL = 2000;
const LONG DEF_DTMF_DETECT_THR_ROW2ND = 2000;
const LONG DEF_DTMF_DETECT_THR_COLREL = 2000;
const LONG DEF_DTMF_DETECT_THR_COL2ND = 2000;
const LONG DEF_DTMF_DETECT_THR_SIGNAL = 1900;
const LONG DEF_DEBUG_SWITCH = 0;
const LONG DEF_HANGUP_TIMES = 3;
const LONG DEF_HELLO_ENERGY_VALUE = 25;
const LONG DEF_ANSWER_JUDGE_BY_PC_VOICE = 1;
const LONG DEF_BUSYTONE_SINGLE_FRE1 = 420;
const LONG DEF_BUSYTONE_SINGLE_FRE2 = 450;
const LONG DEF_HOOK_SMOOTH = 200;
const LONG DEF_RING_SMOOTH = 200;
const LONG DEF_SLIC_FLASH_JUDGE_TIME = 500;
const LONG DEF_SLIC_RING_TIME = 1000;
const LONG DEF_SLIC_STOP_RING_TIME = 4000;
const LONG DEF_MISS_CALL_TIME = 7000;
const LONG DEF_START_FSK_RECV_ON_RING = 1;
const LONG DEF_RECORD_CALLER_AUTOMATICALLY  = 0;
const LONG DEF_CALLER_TYPE = 1;
const LONG DEF_RECORD_LENGTH_OF_CALLER = 10;
const LONG DEF_ENABLE_DETECT_DIAL_TONE_BEFORE_DIAL = 0;
const LONG DEF_BUSY_TONE_TIME = 350;
const LONG DEF_BUSY_SILENCE_TIME = 350;
const LONG DEF_BUSY_VALID = 0;
const LONG DEF_AC_PROGRAM_CODE = 0;
const LONG DEF_DUAL_BUSY_TONE = 0;
const LONG DEF_BUSY_TONE_ENERGY = 21;
const LONG DEF_MAX_INTERVAL_BUSYTONE_TO_SUM = 8;
const LONG DEF_HOWLING_ENERGY = 9;
const LONG DEF_HOWLING_LENGTH = 6000;
		   

long   WINAPI phonicfg_Open(long Type) ;
long   WINAPI phonicfg_GetDebugSwitch();
float  WINAPI phonicfg_GetAnalogSetting_dtmf_twist();
long   WINAPI phonicfg_GetAnalogSetting_dtmf_detect_thr_stdtwi();
long   WINAPI phonicfg_GetAnalogSetting_dtmf_detect_thr_revtwi();
long   WINAPI phonicfg_GetAnalogSetting_dtmf_detect_thr_rowrel();
long   WINAPI phonicfg_GetAnalogSetting_dtmf_detect_thr_row2nd();
long   WINAPI phonicfg_GetAnalogSetting_dtmf_detect_thr_colrel();
long   WINAPI phonicfg_GetAnalogSetting_dtmf_detect_thr_col2nd();
long   WINAPI phonicfg_GetAnalogSetting_dtmf_detect_thr_sig();
long   WINAPI phonicfg_GetAnalogSetting_dtmf_detect_window();
long   WINAPI phonicfg_GetAnalogSetting_dtmf_detect_window_hook_on();

long   WINAPI phonicfg_GetAnalogSetting_check_hangup_times();
long   WINAPI phonicfg_GetAnalogSetting_check_hello_energy_value();
long   WINAPI phonicfg_GetAnalogSetting_answer_judge_by_pc_voice();
long   WINAPI phonicfg_GetAnalogSetting_busytone_single_fre1();
long   WINAPI phonicfg_GetAnalogSetting_busytone_single_fre2();
long   WINAPI phonicfg_GetAnalogSetting_hook_smooth();
long   WINAPI phonicfg_GetAnalogSetting_ring_smooth();
long   WINAPI phonicfg_GetAnalogSetting_slic_flash_judge_time();
long   WINAPI phonicfg_GetAnalogSetting_slic_ring_time();
long   WINAPI phonicfg_GetAnalogSetting_slic_stop_ring_time();
long   WINAPI phonicfg_GetAnalogSetting_miss_call_time();
long   WINAPI phonicfg_GetAnalogSetting_start_fsk_recv_on_ring();
long   WINAPI phonicfg_GetAnalogSetting_record_caller_automatically();
long   WINAPI phonicfg_GetAnalogSetting_caller_type();
long   WINAPI phonicfg_GetAnalogSetting_record_length_of_caller();
long   WINAPI phonicfg_GetAnalogSetting_enalbe_detect_dial_tone_before_dial();
long   WINAPI phonicfg_GetAnalogSetting_Tone_Info(void* toneInfo);
long   WINAPI phonicfg_GetAnalogSetting_ac_program_code();
long   WINAPI phonicfg_Get_ISDN_record_card_Config(long cardNo,long* setting,long size);
long   WINAPI phonicfg_GetAnalogSetting_dual_busy_tone();
long   WINAPI phonicfg_GetAnalogSetting_busy_tone_energy();
long   WINAPI phonicfg_GetAnalogSetting_max_interval_busytone_to_sum();
long   WINAPI phonicfg_GetAnalogSetting_howling_energy();
long   WINAPI phonicfg_GetAnalogSetting_howling_length();


void   WINAPI phonicfg_SetDebugSwitch(long iEnable);          //return 0 for success, -1 for failed
void   WINAPI phonicfg_SetAnalogSetting_dtmf_twist(float value);
void   WINAPI phonicfg_SetAnalogSetting_dtmf_detect_thr_stdtwi(int value);
void   WINAPI phonicfg_SetAnalogSetting_dtmf_detect_thr_revtwi(int value);
void   WINAPI phonicfg_SetAnalogSetting_dtmf_detect_thr_rowrel(int value);
void   WINAPI phonicfg_SetAnalogSetting_dtmf_detect_thr_row2nd(int value);
void   WINAPI phonicfg_SetAnalogSetting_dtmf_detect_thr_colrel(int value);
void   WINAPI phonicfg_SetAnalogSetting_dtmf_detect_thr_col2nd(int value);
void   WINAPI phonicfg_SetAnalogSetting_dtmf_detect_thr_sig(int value);
void   WINAPI phonicfg_SetAnalogSetting_dtmf_detect_window(int value);
void   WINAPI phonicfg_SetAnalogSetting_dtmf_detect_window_hook_on(int value);
void   WINAPI phonicfg_SetAnalogSetting_check_hangup_times(int value);
void   WINAPI phonicfg_SetAnalogSetting_check_hello_energy_value(int value);
void   WINAPI phonicfg_SetAnalogSetting_answer_judge_by_pc_voice(int value);
void   WINAPI phonicfg_SetAnalogSetting_busytone_single_fre1(int value);
void   WINAPI phonicfg_SetAnalogSetting_busytone_single_fre2(int value);
void   WINAPI phonicfg_SetAnalogSetting_hook_smooth(int value);
void   WINAPI phonicfg_SetAnalogSetting_ring_smooth(int value);
void   WINAPI phonicfg_SetAnalogSetting_slic_flash_judge_time(int value);
void   WINAPI phonicfg_SetAnalogSetting_slic_ring_time(int value);
void   WINAPI phonicfg_SetAnalogSetting_slic_stop_ring_time(int value);
void   WINAPI phonicfg_SetAnalogSetting_miss_call_time(int value);
void   WINAPI phonicfg_SetAnalogSetting_start_fsk_recv_on_ring(int value);
void   WINAPI phonicfg_SetAnalogSetting_record_caller_automatically(int value);
void   WINAPI phonicfg_SetAnalogSetting_caller_type(int value);
void   WINAPI phonicfg_SetAnalogSetting_record_length_of_caller(int value);
void   WINAPI phonicfg_SetAnalogSetting_enalbe_detect_dial_tone_before_dial(int value);
void   WINAPI phonicfg_SetAnalogSetting_Tone_Info(void* toneInfo);
void   WINAPI phonicfg_SetAnalogSetting_ac_program_code(int value);
void   WINAPI phonicfg_Set_ISDN_record_card_Config(long cardNo,long* setting,long size);
void   WINAPI phonicfg_SetAnalogSetting_dual_busy_tone(int value);
void   WINAPI phonicfg_SetAnalogSetting_busy_tone_energy(int value);
void   WINAPI phonicfg_SetAnalogSetting_max_interval_busytone_to_sum(int value);
void   WINAPI phonicfg_SetAnalogSetting_howling_energy(int value);
void   WINAPI phonicfg_SetAnalogSetting_howling_length(int value);

#ifdef	__cplusplus
};
#endif


#endif //__PHONIC_CONFIG_API_H__
